@extends('admin.inc.base')
@section('content')
    <link rel="stylesheet" type="text/css" href="/public/statics/libs/wangEditor/dist/css/wangEditor.min.css">
    <script type="text/javascript" src="/public/statics/libs/wangEditor/dist/js/lib/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="/public/statics/libs/wangEditor/dist/js/wangEditor.js"></script>

    <div class="panel panel-default">
        <div class="panel-heading">
            编辑文章
        </div>
        <div class="panel-body">
            <form action="/administrator/post/{{ $post->id }}" method="post">
                <div class="form-group">
                    <label for="">标题</label>
                    <input type="text" class="form-control" value="{{ $post -> title }}" name="title"  placeholder="文章标题">
                </div>

                <div class="form-group">
                    <label for="">文章分类</label>
                    <select name="cid" class="form-control">
                        <option value="0">默认</option>
                        @foreach( $cids as $key => $val )
                            <option value="{{ $val->id }}" @if($val->id == $post->cid) selected @endif>{{ $val->title }}</option>
                        @endforeach


                    </select>
                </div>

                <div class="form-group">
                    <label for="">内容</label>
                       <textarea name="content" id="content" class="form-control" style="height:400px;">
                            {{ $post -> content }}
                       </textarea>

                    <p class="help-block"></p>
                </div>

                <button type="submit" class="btn btn-default">提交</button>
            </form>
        </div>
    </div>

    <script type="text/javascript">
        var editor = new wangEditor('content');
        editor.create();
    </script>

@endsection